<div class="p-fluid">
  <div class="p-field">
    <p-table [value]="orders" [scrollable]="true" scrollHeight="400px" 
             selectionMode="single" [(selection)]="selectedOrder"
             [style]="{width: '100%'}"
             [tableStyle]="{'min-width': '50rem'}"
             [rowHover]="true"
             styleClass="p-datatable-striped">
      <ng-template pTemplate="header">
        <tr>
          <th>单号</th>
          <th>名称</th>
          <th>供应商</th>
          <th>数量</th>
          <th>金额</th>
        </tr>
      </ng-template>
      <ng-template pTemplate="body" let-order>
        <tr [pSelectableRow]="order">
          <td>{{order.orderNumber}}</td>
          <td>{{order.name}}</td>
          <td>{{order.vendor}}</td>
          <td>{{order.quantity}}</td>
          <td>{{order.amount}}</td>
        </tr>
      </ng-template>
      <ng-template pTemplate="emptymessage">
        <tr>
          <td colspan="5" class="text-center">暂无数据</td>
        </tr>
      </ng-template>
    </p-table>
  </div>
  <div class="p-dialog-footer">
    <button pButton type="button" label="确定" (click)="confirm()" [disabled]="!selectedOrder"></button>
    <button pButton type="button" label="取消" (click)="close()" class="p-button-secondary"></button>
  </div>
</div>